import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    username: '',
    password: '',
    message: [
      {
        timeStamp: '2020/08/04 12:00:32',
        info: '西门烧烤店黄啤库存只剩1桶,请联系送货！'
      },
      {
        timeStamp: '2020/08/03 11:00:32',
        info: '大坪店黄啤库存只剩0.5桶,请联系送货！'
      },
      {
        timeStamp: '2020/08/02 12:00:32',
        info: '龙湖天街店设备断线！'
      },
      {
        timeStamp: '2020/08/01 11:00:32',
        info: '观音桥店黑啤库存已经清空，请尽快送货！'
      },
      {
        timeStamp: '2020/08/01 09:00:32',
        info: '观音桥店黄啤库存已经清空，请尽快送货！'
      }
    ]
  },
  mutations: {
    userInfo (state, payload) {
      state.username = payload.username
      state.password = payload.password
    }
  },
  actions: {},
  modules: {}
})
